.TH "DVFrame" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
DVFrame \- 
.SH SYNOPSIS
.br
.PP
.PP
Inherits \fBFrame\fP.
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBDVFrame\fP ()"
.br
.ti -1c
.RI "void \fBSetDataLen\fP (int len)"
.br
.ti -1c
.RI "bool \fBGetTimeCode\fP (\fBTimeCode\fP &timeCode)"
.br
.ti -1c
.RI "bool \fBGetRecordingDate\fP (struct tm &recDate)"
.br
.ti -1c
.RI "bool \fBIsNewRecording\fP (void)"
.br
.ti -1c
.RI "bool \fBIsNormalSpeed\fP (void)"
.br
.ti -1c
.RI "bool \fBIsComplete\fP (void)"
.br
.ti -1c
.RI "int \fBGetWidth\fP ()"
.br
.ti -1c
.RI "int \fBGetHeight\fP ()"
.br
.ti -1c
.RI "float \fBGetFrameRate\fP ()"
.br
.ti -1c
.RI "bool \fBIsHDV\fP ()"
.br
.ti -1c
.RI "bool \fBGetSSYBPack\fP (int packNum, \fBPack\fP &pack)"
.br
.ti -1c
.RI "bool \fBGetVAUXPack\fP (int packNum, \fBPack\fP &pack)"
.br
.ti -1c
.RI "bool \fBGetAAUXPack\fP (int packNum, \fBPack\fP &pack)"
.br
.ti -1c
.RI "bool \fBGetAudioInfo\fP (\fBAudioInfo\fP &info)"
.br
.ti -1c
.RI "bool \fBGetVideoInfo\fP (\fBVideoInfo\fP &info)"
.br
.ti -1c
.RI "int \fBGetFrameSize\fP (void)"
.br
.ti -1c
.RI "bool \fBIsPAL\fP (void)"
.br
.ti -1c
.RI "int \fBExtractAudio\fP (void *sound)"
.br
.ti -1c
.RI "void \fBExtractHeader\fP (void)"
.br
.ti -1c
.RI "int \fBExtractAudio\fP (int16_t **channels)"
.br
.ti -1c
.RI "int \fBExtractRGB\fP (void *rgb)"
.br
.ti -1c
.RI "int \fBExtractPreviewRGB\fP (void *rgb)"
.br
.ti -1c
.RI "int \fBExtractYUV\fP (void *yuv)"
.br
.ti -1c
.RI "int \fBExtractPreviewYUV\fP (void *yuv)"
.br
.ti -1c
.RI "bool \fBIsWide\fP (void)"
.br
.ti -1c
.RI "void \fBSetRecordingDate\fP (time_t *datetime, int frame)"
.br
.ti -1c
.RI "void \fBSetTimeCode\fP (int frame)"
.br
.ti -1c
.RI "void \fBDeinterlace\fP (void *image, int bpp)"
.br
.in -1c
.SS "Public Attributes"

.in +1c
.ti -1c
.RI "dv_decoder_t * \fBdecoder\fP"
.br
.ti -1c
.RI "int16_t * \fBaudio_buffers\fP [4]"
.br
.in -1c
.SH "Constructor & Destructor Documentation"
.PP 
.SS "DVFrame::DVFrame ()"ructor
.PP
All \fBDVFrame\fP objects share a set of lookup maps, which are initalized once (we are using a variant of the Singleton pattern). 
.SH "Member Function Documentation"
.PP 
.SS "int DVFrame::ExtractAudio (int16_t ** channels)"retrieves the audio data from the frame
.PP
The DV frame contains audio data mixed in the video data blocks, which can be retrieved easily using this function.
.PP
The audio data consists of 16 bit, two channel audio samples (a 16 bit word for channel 1, followed by a 16 bit word for channel 2 etc.)
.PP
\fBParameters:\fP
.RS 4
\fIchannels\fP an array of buffers of audio data, one per channel, up to four channels 
.RE
.PP
\fBReturns:\fP
.RS 4
the number of bytes put into the buffer, or 0 if no audio data could be retrieved 
.RE
.PP

.SS "int DVFrame::ExtractAudio (void * sound)"retrieves the audio data from the frame
.PP
The DV frame contains audio data mixed in the video data blocks, which can be retrieved easily using this function.
.PP
The audio data consists of 16 bit, two channel audio samples (a 16 bit word for channel 1, followed by a 16 bit word for channel 2 etc.)
.PP
\fBParameters:\fP
.RS 4
\fIsound\fP a pointer to a buffer that holds the audio data 
.RE
.PP
\fBReturns:\fP
.RS 4
the number of bytes put into the buffer, or 0 if no audio data could be retrieved 
.RE
.PP

.SS "bool DVFrame::GetAAUXPack (int packNum, \fBPack\fP & pack)"gets an audio auxiliary data packet
.PP
Every DIF block in the audio section contains 5 bytes audio auxiliary data and 72 bytes of audio data. The function searches through all DIF blocks although AAUX packets are only allowed in certain defined DIF blocks.
.PP
\fBParameters:\fP
.RS 4
\fIpackNum\fP the AAUX package id to return 
.br
\fIpack\fP a reference to the variable where the result is stored 
.RE
.PP
\fBReturns:\fP
.RS 4
true for success, false if no pack could be found 
.RE
.PP

.SS "bool DVFrame::GetAudioInfo (\fBAudioInfo\fP & info)"gets the audio properties of this frame
.PP
get the sampling frequency and the number of samples in this particular DV frame (which can vary)
.PP
\fBParameters:\fP
.RS 4
\fIinfo\fP the \fBAudioInfo\fP record 
.RE
.PP
\fBReturns:\fP
.RS 4
true, if audio properties could be determined 
.RE
.PP

.SS "float DVFrame::GetFrameRate ()\fC [virtual]\fP"get the video frame rate
.PP
\fBReturns:\fP
.RS 4
frames per second 
.RE
.PP

.PP
Reimplemented from \fBFrame\fP.
.SS "int DVFrame::GetFrameSize (void)"gets the size of the frame
.PP
Depending on the type (PAL or NTSC) of the frame, the length of the frame is returned
.PP
\fBReturns:\fP
.RS 4
the length of the frame in Bytes 
.RE
.PP

.SS "int DVFrame::GetHeight ()\fC [virtual]\fP"Get the frame image height.
.PP
\fBReturns:\fP
.RS 4
the height in pixels. 
.RE
.PP

.PP
Reimplemented from \fBFrame\fP.
.SS "bool DVFrame::GetRecordingDate (struct tm & recDate)\fC [virtual]\fP"gets the date and time of recording of this frame
.PP
Returns a struct tm with date and time of recording of this frame.
.PP
This code courtesy of Andy (http://www.videox.net/)
.PP
\fBParameters:\fP
.RS 4
\fIrecDate\fP the time and date of recording of this frame 
.RE
.PP
\fBReturns:\fP
.RS 4
true for success, false if no date or time information could be found 
.RE
.PP

.PP
Reimplemented from \fBFrame\fP.
.SS "bool DVFrame::GetSSYBPack (int packNum, \fBPack\fP & pack)"gets a subcode data packet
.PP
This function returns a SSYB packet from the subcode data section.
.PP
\fBParameters:\fP
.RS 4
\fIpackNum\fP the SSYB package id to return 
.br
\fIpack\fP a reference to the variable where the result is stored 
.RE
.PP
\fBReturns:\fP
.RS 4
true for success, false if no pack could be found 
.RE
.PP

.SS "bool DVFrame::GetTimeCode (\fBTimeCode\fP & timeCode)\fC [virtual]\fP"gets the timecode information of this frame
.PP
Returns a string with the timecode of this frame. The timecode is the relative location of this frame on the tape, and is defined by hour, minute, second and frame (within the last second).
.PP
\fBParameters:\fP
.RS 4
\fItimeCode\fP the \fBTimeCode\fP struct 
.RE
.PP
\fBReturns:\fP
.RS 4
true for success, false if no timecode information could be found 
.RE
.PP

.PP
Reimplemented from \fBFrame\fP.
.SS "bool DVFrame::GetVAUXPack (int packNum, \fBPack\fP & pack)"gets a video auxiliary data packet
.PP
Every DIF block in the video auxiliary data section contains 15 video auxiliary data packets, for a total of 45 VAUX packets. As the position of a VAUX packet is fixed, we could directly look it up, but I choose to walk through all data as with the other GetXXXX routines.
.PP
\fBParameters:\fP
.RS 4
\fIpackNum\fP the VAUX package id to return 
.br
\fIpack\fP a reference to the variable where the result is stored 
.RE
.PP
\fBReturns:\fP
.RS 4
true for success, false if no pack could be found 
.RE
.PP

.SS "int DVFrame::GetWidth ()\fC [virtual]\fP"Get the frame image width.
.PP
\fBReturns:\fP
.RS 4
the width in pixels. 
.RE
.PP

.PP
Reimplemented from \fBFrame\fP.
.SS "bool DVFrame::IsComplete (void)\fC [virtual]\fP"check whether we have received as many bytes as expected for this frame
.PP
\fBReturns:\fP
.RS 4
true if this frames is completed, false otherwise 
.RE
.PP

.PP
Reimplemented from \fBFrame\fP.
.SS "bool DVFrame::IsNewRecording (void)\fC [virtual]\fP"checks whether this frame is the first in a new recording
.PP
To determine this, the function looks at the recStartPoint bit in AAUX pack 51.
.PP
\fBReturns:\fP
.RS 4
true if this frame is the start of a new recording 
.RE
.PP

.PP
Reimplemented from \fBFrame\fP.
.SS "bool DVFrame::IsNormalSpeed (void)"checks whether this frame is playing at normal speed
.PP
To determine this, the function looks at the speed bit in AAUX pack 51.
.PP
\fBReturns:\fP
.RS 4
true if this frame is playing at normal speed 
.RE
.PP

.SS "bool DVFrame::IsPAL (void)"checks whether the frame is in PAL or NTSC format
.PP
\fBTodo\fP
.RS 4
function can't handle 'empty' frame 
.RE
.PP
\fBReturns:\fP
.RS 4
true for PAL frame, false for a NTSC frame 
.RE
.PP

.SS "bool DVFrame::IsWide (void)"Get the frame aspect ratio.
.PP
Indicates whether frame aspect ration is normal (4:3) or wide (16:9).
.PP
\fBReturns:\fP
.RS 4
true if the frame is wide (16:9), false if unknown or normal. 
.RE
.PP

.SS "void DVFrame::SetRecordingDate (time_t * datetime, int frame)"Set the RecordingDate of the frame.
.PP
This updates the calendar date and time and the timecode. However, timecode is derived from the time in the datetime parameter and frame number. Use SetTimeCode for more \fBcontrol\fP over timecode.
.PP
\fBParameters:\fP
.RS 4
\fIdatetime\fP A simple time value containing the RecordingDate and time information. The time in this structure is automatically incremented by one second depending on the frame parameter and updatded. 
.br
\fIframe\fP A zero-based running frame sequence/serial number. This is used both in the timecode as well as a timestamp on dif block headers. 
.RE
.PP

.SS "void DVFrame::SetTimeCode (int frame)"Set the \fBTimeCode\fP of the frame.
.PP
This function takes a zero-based frame counter and automatically derives the timecode.
.PP
\fBParameters:\fP
.RS 4
\fIframe\fP The frame counter. 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
